package cn.xd.core.ddd.value.basic;

import cn.xd.common.exception.BizException;
import lombok.Getter;

import java.io.Serializable;

/**
 * @author mirzaLin
 * @data 2023/11/14
 * @description 实体属性父类
 **/
@Getter
public class Value<T extends Serializable> implements Serializable {

    private T value;

    public Value() {
    }

    public Value(T value) {
        this.value = value;
    }

    public Value<T> setValue(T value) {
        this.value = value;
        return this;
    }

    public void validate(T value) throws BizException {
    }

    @Override
    public String toString() {
        return value.toString();
    }
}
